module.exports = {
  // 主要是下跌途中的小反弹，然后去再次做空他
  sellIfPositivePreDownTrendUp () {
    // 或者80，或者小点
    if (this.analysisInfo15m.ema5W10B20KeepInfo.closeLowRate >= 50) {
      // 正向卖出，如果从低点反弹了很多的，那就不做，用来应对暴跌以后金针探底的
      return
    }
    // 整体模式1
    if (
      !this.analysisInfo1d.hasFullData &&
      this.analysisInfo4h.macd < 0 &&
      this.analysisInfo4h.ema5B10B20Days >= 1 &&
      (
        this.analysisInfo4h.kdjDiff < 0 ||
        this.analysisInfo4h.macdDownDays >= 8 ||
        this.analysisInfo4h.ema5B10B20Days >= 8
      ) &&
      this.analysisInfo1h.macd < 0 &&
      this.analysisInfo1h.ema5B10B20Days >= 1 &&
      (
        this.analysisInfo1h.kdjDiff < 0 ||
        this.analysisInfo1h.macdDownDays >= 8 ||
        this.analysisInfo1h.ema5B10B20Days >= 8
      )
    ) {
      if (
        this.analysisInfo15m.ema5W10B20Days >= 1 &&
        this.analysisInfo15m.kdjDiff > 0 &&
        this.analysisInfo15m.isKdjDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0001', {
          level: 0,
          rate: 0.5
        })
      }
      if (
        this.analysisInfo15m.ema5B10B20Days >= 1 &&
        this.analysisInfo15m.ema5B10B20Days <= 2 &&
        this.analysisInfo15m.ema5W10B20Days >= 16 &&
        this.analysisInfo15m.kdjDiff < 0 &&
        this.analysisInfo15m.isMacdDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0002', {
          level: 0,
          rate: 0.5
        })
      }
      if (
        this.analysisInfo15m.ema5B10B20Days >= 8 &&
        this.analysisInfo15m.macd > 0 &&
        this.analysisInfo15m.isMacdDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0003', {
          level: 0,
          rate: 0.5
        })
      }
      if (
        this.analysisInfo15m.ema5B10B20Days >= 8 &&
        this.analysisInfo15m.kdjDiff > 0 &&
        this.analysisInfo15m.isKdjDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0004', {
          level: 0,
          rate: 0.5
        })
      }
    }
    // 整体模式2
    if (
      !this.analysisInfo1d.hasFullData &&
      this.analysisInfo4h.isMacdDecline &&
      this.analysisInfo4h.macd < 0 &&
      this.analysisInfo4h.kdjDiff < 0 &&
      this.analysisInfo1h.kdjDownDays >= 12 &&
      this.analysisInfo1h.macdDownDays >= 8 &&
      this.analysisInfo1h.ema5B10B20Days >= 1
    ) {
      if (
        this.analysisInfo15m.ema5W10B20Days >= 1 &&
        this.analysisInfo15m.kdjDiff > 0 &&
        this.analysisInfo15m.isKdjDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0101', {
          level: 0,
          rate: 0.5
        })
      }
      if (
        this.analysisInfo15m.ema5B10B20Days >= 1 &&
        this.analysisInfo15m.ema5B10B20Days <= 2 &&
        this.analysisInfo15m.ema5W10B20Days >= 16 &&
        this.analysisInfo15m.kdjDiff < 0 &&
        this.analysisInfo15m.isMacdDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0102', {
          level: 0,
          rate: 0.5
        })
      }
      if (
        this.analysisInfo15m.ema5B10B20Days >= 8 &&
        this.analysisInfo15m.macd > 0 &&
        this.analysisInfo15m.isMacdDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0103', {
          level: 0,
          rate: 0.5
        })
      }
      if (
        this.analysisInfo15m.ema5B10B20Days >= 8 &&
        this.analysisInfo15m.kdjDiff > 0 &&
        this.analysisInfo15m.isKdjDecline
      ) {
        this.setSellByPrePositive('sellIfPreReverseTrend-0104', {
          level: 0,
          rate: 0.5
        })
      }
    }
  },
  sellIfPositivePreTrend () {
    this.sellIfPositivePreDownTrendUp()
  }
}
